import { request, config, ecityTable } from 'utils'

const { query } = ecityTable;
const { api } = config

const {
  ECityMonitorMetas,
  
  ECityWaterQualityIndicators,
  ECityWaterQualityIndicatorsByYear,
  ECityQualityIndicatorsAnalysis,
  ECityExceedingStandardAnalysis,
} = api

export function queryIndicators(params) {
  const { payload: data, tablename } = params;
  return query({ url: ECityMonitorMetas, data }, tablename)
}

export function queryWaterQualityIndicators(data) {
  return request({
    url: ECityWaterQualityIndicators,
    data,
    method: 'post',
    headers: {
      'Content-type': 'application/x-www-form-urlencoded'
    },
  })
}

export function queryWaterQualityIndicatorsByYear(data) {
  return request({
    url: ECityWaterQualityIndicatorsByYear,
    data,
    method: 'post',
    headers: {
      'Content-type': 'application/x-www-form-urlencoded'
    },
  })
}

export function queryQualityIndicatorsAnalysis(data) {
  return request({
    url: ECityQualityIndicatorsAnalysis,
    data,
    method: 'post',
    headers: {
      'Content-type': 'application/x-www-form-urlencoded'
    },
  })
}

export function queryExceedingStandardAnalysis(data) {
  return request({
    url: ECityExceedingStandardAnalysis,
    data,
    method: 'post',
    headers: {
      'Content-type': 'application/x-www-form-urlencoded'
    },
  })
}